#define I2C_SlaveAddr_Encoder 3
#define I2C_SlaveAddr_NeoPixel 5
#define I2C_SlaveAddr_SRHC04 7


/////////////////////////////////////////////////////////////////////////// I2C_SlaveAddr_Encoder
#define Cmd_Encoder_SetCounter 0
#define Cmd_Encoder_Mp3Cmd 1

//////////////////////////////////////////////// Master to Slave
typedef struct 
{
  long Data[2];
}tEncoderSetCounter;

typedef struct 
{
  char Cmd;
  #define Mp3_Play    'g'
  #define Mp3_Pause   'p'
  #define Mp3_Stop    's'
  #define Mp3_Resume  'r'
  #define Mp3_Next    '>'
  #define Mp3_Prev    '<'  
  #define Mp3_Vol     'v' 
  unsigned char Data;
}tMsg_Mp3;

//////////////////////////////////////////////// Slave to Master
typedef struct 
{
  long Counter[2];
  unsigned char Mp3Status;
  unsigned char IrSens;
}tEncoder;

/////////////////////////////////////////////////////////////////////////// I2C_SlaveAddr_SRHC04
//////////////////////////////////////////////// Master to Slave
//////////////////////////////////////////////// Slave to Master
typedef struct 
{
  unsigned short Ch[8];
}tDistance_mm;

/////////////////////////////////////////////////////////////////////////// I2C_SlaveAddr_NeoPixel
#define Cmd_NeoPixel_CmdOnly 0
#define Cmd_NeoPixel_BarGraph 1
#define Cmd_NeoPixel_Char 2
#define Cmd_NeoPixel_String 3
#define Cmd_NeoPixel_Pixel 4
//////////////////////////////////////////////// Master to Slave
typedef struct 
{
  unsigned char Ch[8];
}tBarGraph;

typedef struct 
{
  char Param;
}tChar;

typedef struct 
{
  char Param[10];
}tString;

typedef struct 
{ 
  struct{
    unsigned short Y0 :2;
    unsigned short Y1 :2;
    unsigned short Y2 :2;
    unsigned short Y3 :2;
    unsigned short Y4 :2;
    unsigned short Y5 :2;
    unsigned short Y6 :2;
    unsigned short Y7 :2;
  }X[5];
}tPixel;

#define Pxl_OFF 0
#define Pxl_RED 1
#define Pxl_GREEN 2
#define Pxl_BLUE 3

//////////////////////////////////////////////// Slave to Master
typedef struct 
{
  unsigned char Data;
}tCurStatus;

#define DeclarePktStruct(StructName) struct{char Cmd;\
                                            t##StructName Data;}CmdPktI2C_##StructName


